package com.linkage.jz.bankruptcy.bean;

import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.google.gson.annotations.SerializedName;
import com.linkage.jz.bankruptcy.utils.LogUtil;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * @author AFAP
 * 讨论
 */
public class ProPublic implements Serializable {

    private ProManageInfo manager;

    public String getManagerId() {
        return managerId;
    }

    public void setManagerId(String managerId) {
        this.managerId = managerId;
    }

    private String managerId;


    public ProManageInfo getManager() {
        return manager;
    }

    public void setManager(ProManageInfo manager) {
        this.manager = manager;
    }

    public ProManageInfo getOtherMember() {
        return otherMember;
    }

    public void setOtherMember(ProManageInfo otherMember) {
        this.otherMember = otherMember;
    }

    private ProManageInfo otherMember;
    private String id; // 话题id
    private String bankruptcyProjectId; // 项目ID
    private ProNodeInfo projectSchedule;
    private String publicName; // 公示名称
    private String publicType; // 公示类型
    private String publicDetail; // 公示说明
    private CommonStatusInfo openStatus;
    private int number; // 公示对象人数
    private List<TaskAtta> attachmentList;
    private String opBy;
    private long opAt;
    private boolean delFlag;


    private boolean isFirst = false;// 是否是分组第一个


    private List<MemberBean> memberList;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getBankruptcyProjectId() {
        return bankruptcyProjectId;
    }

    public void setBankruptcyProjectId(String bankruptcyProjectId) {
        this.bankruptcyProjectId = bankruptcyProjectId;
    }

    public String getPublicName() {
        return publicName;
    }

    public void setPublicName(String publicName) {
        this.publicName = publicName;
    }

    public String getPublicType() {
        return publicType;
    }

    public void setPublicType(String publicType) {
        this.publicType = publicType;
    }

    public CommonStatusInfo getOpenStatus() {
        return openStatus;
    }

    public void setOpenStatus(CommonStatusInfo openStatus) {
        this.openStatus = openStatus;
    }

    public int getNumber() {
        return number;
    }

    public void setNumber(int number) {
        this.number = number;
    }

    public List<TaskAtta> getAttachmentList() {
        return attachmentList;
    }

    public void setAttachmentList(List<TaskAtta> attachmentList) {
        this.attachmentList = attachmentList;
    }

    public String getOpBy() {
        return opBy;
    }

    public void setOpBy(String opBy) {
        this.opBy = opBy;
    }

    public long getOpAt() {
        return opAt;
    }

    public void setOpAt(long opAt) {
        this.opAt = opAt;
    }

    public boolean isDelFlag() {
        return delFlag;
    }

    public void setDelFlag(boolean delFlag) {
        this.delFlag = delFlag;
    }

    public boolean isFirst() {
        return isFirst;
    }

    public void setFirst(boolean first) {
        isFirst = first;
    }

    public String getPublicDetail() {
        return publicDetail;
    }

    public void setPublicDetail(String publicDetail) {
        this.publicDetail = publicDetail;
    }

    public static List<ProPublic> parse(JsonArray arr) {
        List<ProPublic> list = new ArrayList<>();
        for (int i = 0; i < arr.size(); i++) {
            list.add(parse(arr.get(i).getAsJsonObject()));
        }
        return list;
    }

    public static ProPublic parse(JsonObject obj) {
        ProPublic bean = new Gson().fromJson(obj, ProPublic.class);
        LogUtil.d("", bean.toString());
        return bean;
    }

    public ProNodeInfo getProjectSchedule() {
        return projectSchedule;
    }

    public void setProjectSchedule(ProNodeInfo projectSchedule) {
        this.projectSchedule = projectSchedule;
    }

    public List<MemberBean> getMemberList() {
        return memberList;
    }

    public void setMemberList(List<MemberBean> memberList) {
        this.memberList = memberList;
    }


    public static class MemberBean implements Serializable {
        /**
         * id : a7b0787c21ea41e6ad6e88096d40e422
         * publicId : 26d62a074bd44326a4ba8d5769c7aaa1
         * creditorId : e8dcacabbdff470891612eaf97e0d190
         * opBy : 323e5a26d5d74200bfd3dceb5be1b56f
         * opAt : 1557910672
         * delFlag : false
         */

        @SerializedName("id")
        private String idX;
        private String publicId;
        private String creditorId;
        private String creditorName;
        @SerializedName("opBy")
        private String opByX;
        @SerializedName("opAt")
        private int opAtX;
        @SerializedName("delFlag")
        private boolean delFlagX;

        public String getIdX() {
            return idX;
        }

        public void setIdX(String idX) {
            this.idX = idX;
        }

        public String getPublicId() {
            return publicId;
        }

        public void setPublicId(String publicId) {
            this.publicId = publicId;
        }

        public String getCreditorId() {
            return creditorId;
        }

        public void setCreditorId(String creditorId) {
            this.creditorId = creditorId;
        }

        public String getCreditorName() {
            return creditorName;
        }

        public void setCreditorName(String creditorName) {
            this.creditorName = creditorName;
        }

        public String getOpByX() {
            return opByX;
        }

        public void setOpByX(String opByX) {
            this.opByX = opByX;
        }

        public int getOpAtX() {
            return opAtX;
        }

        public void setOpAtX(int opAtX) {
            this.opAtX = opAtX;
        }

        public boolean isDelFlagX() {
            return delFlagX;
        }

        public void setDelFlagX(boolean delFlagX) {
            this.delFlagX = delFlagX;
        }
    }
}
